<?php
include "../../../BLL/CanBoBLL.php";

 $cb = new CanBoBLL();
 //1. tim kiem thong tin can bo theo ma
 echo $cb->getCanBoInfo('1')->gethoten_cb();
 
 //2. lay danh sach thong tin can bo
 //dua du lieu vao select 
 $arr_cbo = array();
 $arr_cbo = $cb->getListCanBo();
echo '<select>';
 foreach($arr_cbo as $canbo){
    echo '<option id="'.$canbo->getma_cb().'">'.$canbo->gethoten_cb().'</option>';
    
 }        
 echo '</select>';

    //3. insert can bo vao trong database
    $cbins = new CanBo();
    $cbins->setCanBo("CB18","H? Th? Thanh Nga","Nga","12345","Ha Noi","nga@gmail.com","Nu","01","khac","kinh","thue","khong","2/16/1992 12:00:00 AM","09787624",123);
    
    //insert du lieu
   $result = $cb->insertCanBo($cbins);
   echo $result;
    
      //4. update can bo vao trong database
    $cbins2 = new CanBo();
    $cbins2->setCanBo("CB18","H? Th? Thanh Nga","Nga","12345","Ha Noi","thunga@gmail.com","Nu","01","khac","kinh","thue","khong","2/16/1992 12:00:00 AM","09787624",123);
    
    //update du lieu
    $result = $cb->updateCanBo($cbins2);
    echo $result;
    
    //delete du lieu
    $ma_cb = "CB18";
    echo $result = $cb->deleteCanBo($ma_cb);
?>